package com.guanglan.utils;

import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

public class CreatePassWordUtil {
	
	private final static Integer COUNT = 1024;
	
	private final static String TYPE = "MD5";
	
	public static String getPwd(String passWord,String salt){
		String hashAlgorithmName = TYPE;
		String credentials = passWord;
	    int hashIterations = COUNT;
	    Object obj = new SimpleHash(hashAlgorithmName, credentials, ByteSource.Util.bytes(salt), hashIterations);
	    return obj.toString();
	}

	public static void main(String[] args) {
		System.out.println(getPwd("123456","521"));
	}
	
}
